<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Users
 *
 * This model represents user authentication data. It operates the following tables:
 * - user account data,
 * - user profiles
 *
 * @package	Sama Manager
 * @author	William Mandai (http://willymandai.com)
 */
class Faqs_model extends CI_Model
{
	
	function get_faqs()
	{
		$this->db->join('users','users.id = faqs.author');
		$query = $this->db->get('faqs');
		if ($query->num_rows() > 0){
			return $query->result_array();
		} 
	}
	function question_details($question)
	{
		$this->db->where('q_id', $question);
		$query = $this->db->get('faqs');
		if ($query->num_rows() > 0){
			return $query->result_array();
		} 
	}

function get_member_profile($profile)
	{
		$this->db->where('id', $profile);
		$this->db->join('roles','roles.r_id = users.role_id');
		$this->db->join('fx_profiles','fx_profiles.user_id = users.id');
		$query = $this->db->get('users');
		if ($query->num_rows() > 0){
			return $query->result_array();
		} 
	}
function login_activities()
	{
		$this->db->join('users','users.id = auth_log.user');
		$query = $this->db->get('auth_log');
		if ($query->num_rows() > 0){
			return $query->result_array();
		} 
	}
function get_logins($id)
	{
		$this->db->where('user', $id);
		//$this->db->where('activated', $activated ? 1 : 0);
		$this->db->join('users','users.id = auth_log.user');
		$query = $this->db->get('auth_log');
		if ($query->num_rows() > 0){
			return $query->result_array();
		} 
	}
}

/* End of file users.php */
/* Location: ./application/models/auth/users.php */